package com.ruoyi.userManage.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.userManage.mapper.BalanceConsumeDetailMapper;
import com.ruoyi.userManage.domain.BalanceConsumeDetail;
import com.ruoyi.userManage.service.IBalanceConsumeDetailService;

/**
 * 余额消费记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-08-12
 */
@Service
public class BalanceConsumeDetailServiceImpl implements IBalanceConsumeDetailService 
{
    @Autowired
    private BalanceConsumeDetailMapper balanceConsumeDetailMapper;

    /**
     * 查询余额消费记录
     * 
     * @param id 余额消费记录主键
     * @return 余额消费记录
     */
    @Override
    public BalanceConsumeDetail selectBalanceConsumeDetailById(Long id)
    {
        return balanceConsumeDetailMapper.selectBalanceConsumeDetailById(id);
    }

    /**
     * 查询余额消费记录列表
     * 
     * @param balanceConsumeDetail 余额消费记录
     * @return 余额消费记录
     */
    @Override
    public List<BalanceConsumeDetail> selectBalanceConsumeDetailList(BalanceConsumeDetail balanceConsumeDetail)
    {
        return balanceConsumeDetailMapper.selectBalanceConsumeDetailList(balanceConsumeDetail);
    }

    /**
     * 新增余额消费记录
     * 
     * @param balanceConsumeDetail 余额消费记录
     * @return 结果
     */
    @Override
    public int insertBalanceConsumeDetail(BalanceConsumeDetail balanceConsumeDetail)
    {
        balanceConsumeDetail.setCreateTime(DateUtils.getNowDate());
        return balanceConsumeDetailMapper.insertBalanceConsumeDetail(balanceConsumeDetail);
    }

    /**
     * 修改余额消费记录
     * 
     * @param balanceConsumeDetail 余额消费记录
     * @return 结果
     */
    @Override
    public int updateBalanceConsumeDetail(BalanceConsumeDetail balanceConsumeDetail)
    {
        balanceConsumeDetail.setUpdateTime(DateUtils.getNowDate());
        return balanceConsumeDetailMapper.updateBalanceConsumeDetail(balanceConsumeDetail);
    }

    /**
     * 批量删除余额消费记录
     * 
     * @param ids 需要删除的余额消费记录主键
     * @return 结果
     */
    @Override
    public int deleteBalanceConsumeDetailByIds(Long[] ids)
    {
        return balanceConsumeDetailMapper.deleteBalanceConsumeDetailByIds(ids);
    }

    /**
     * 删除余额消费记录信息
     * 
     * @param id 余额消费记录主键
     * @return 结果
     */
    @Override
    public int deleteBalanceConsumeDetailById(Long id)
    {
        return balanceConsumeDetailMapper.deleteBalanceConsumeDetailById(id);
    }
}
